#include <REGX52.H>
#include "Key.h"
#include "Timer0.h"
#include "Delay.h"
#include "LCD1602.h"
unsigned char Sec = 55;
unsigned char Min = 59;
unsigned char Hour = 23;
void main (){
	LCD_Init();
	Timer0Init();
	LCD_ShowString(1,1,"Clock:");
  LCD_ShowString(2,1,"  :  :");
 while(1){
	 	LCD_ShowNum(2,1,Hour,2);
	 	LCD_ShowNum(2,4,Min,2);
	 	LCD_ShowNum(2,7,Sec,2);
	 
	 
	}
	}
unsigned int Count = 0;
void Timero_Routine() interrupt 1
{
	TH0=0xFC;
	TL0=0x18;
	Count++;
	if(Count>=1000){
		Sec++;
		Count=0;
		if(Sec>=60){
		 Sec=0;
			Min++;
			if(Min>=60){
				Min=0;
				Hour++;
				if(Hour>=24){
					Hour=0;
				}
			}
		}
	}		
}